package com.example.drools.spring.entity;

import org.kie.api.time.Calendar;
import org.quartz.impl.calendar.WeeklyCalendar;

/**
 * @author ddsyw
 * @version 1.0
 * @date 2021/12/30 6:03 下午
 * 规则定时执行器
 */
public class CalendarWrapper implements Calendar {

  private WeeklyCalendar cal;

  public CalendarWrapper(WeeklyCalendar cal) {
    this.cal = cal;
  }

  @Override
  public boolean isTimeIncluded(long timestamp) {
    return cal.isTimeIncluded(timestamp);
  }

  public WeeklyCalendar getCal() {
    return cal;
  }

  public void setCal(WeeklyCalendar cal) {
    this.cal = cal;
  }
}
